/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef __HARDWARE_PARTED_H__
#define __HARDWARE_PARTED_H__

#include <NoCopy.h>
#include <list>

// Experimental thing
namespace liba
{

/*template<class PartBase>
class HardwareParted
{
protected:
	typedef std::list<PartBase *> PartList;
	PartList part_list;
public:
	typename PartList::iterator add_dependent(PartBase * dep)
	{
		return part_list.insert( part_list.end(), dep );
	}
	void remove_dependent( typename PartList::iterator it )
	{
		part_list.erase( it );
	}
};

template<class PartBase>
class HardwarePart : public PartBase
{
public:
	typedef std::list<PartBase *> PartList;
	HardwarePart( HardwareParted<PartBase> * hardware ):
		hardware( hardware ),
		PartBase( hardware )
	{
		it = hardware->add_dependent( this );
	}
	virtual ~HardwarePart()
	{
		hardware->remove_dependent( it );
	}
protected:
	HardwareParted<PartBase> * hardware;
private:
	typename PartList::iterator it;
};*/


/*class Direct3DObject
{
public:
	virtual void release()=0;
};

class Texture : public Part<Direct3DObject>
{
	Texture(Hardware * hardware)
		:	Part<Direct3DObject>( hardware )
	{}
};

class Hardware : public HardwareParted<Direct3DObject>
{
//	typedef std::list<Direct3DObject *> List_D3DO;
//	List_D3DO parts_d3do;
//	List_D3DO::iterator add_dependent(Direct3DObject * dep);
//	void remove_dependent( List_D3DO::iterator it );
};

class Hardware2 : public HardwareParted<Texture>
{
//	typedef std::list<Texture *> List_Texture;
//	List_D3DO parts_texture;
//	List_Texture::iterator add_dependent(Texture * dep);
//	void remove_dependent( List_Texture::iterator it );
};*/

} // namespace liba
using namespace liba;

#endif // __HARDWARE_PARTED_H__

